#region Copyright (C) 1998-2009 Autumoon Lab, all rights reserved.
/* *************************************************************
 * Solution:    Autumoon Code Library - Standard Edition
 * 
 * Project:     Business Logic
 * 
 * Description: The management tool class of Language.
 * 
 * Auther:      ZeroCool.
 * 
 * Date:        March 23, 2008.
 * 
 * Copyright (C) 1998-2009 Autumoon Lab, all rights reserved.
 * ************************************************************/
#endregion

#region References
using System;
using System.Data;

using Autumoon.CodeLibrary.CommonFoundation;
using Autumoon.CodeLibrary.DatabaseController;
#endregion

namespace Autumoon.CodeLibrary.BusinessLogic
{
    public class LanguageManager
    {
        // Properties and fields.
        #region Properties and fields
        #endregion

        // Constructors.
        #region Constructors
        #endregion

        // Public methods.
        #region Public Methods
        /// <summary>
        /// Insert a language category.
        /// </summary>
        /// <param name="language">The language category.</param>
        public static void Insert(string language)
        {
            try
            {
                if (String.IsNullOrEmpty(language) || String.IsNullOrEmpty(language.Trim()))
                {
                    throw new ArgumentNullException("Language is null.");
                }

                LanguageController.Insert(language);
            }
            catch
            {
                throw;
            }
        }

        /// <summary>
        /// Delete an existing language.
        /// </summary>
        /// <param name="language">The existing language.</param>
        public static void Delete(string language)
        {
            try
            {
                if (String.IsNullOrEmpty(language) || String.IsNullOrEmpty(language.Trim()))
                {
                    throw new ArgumentNullException("Language is null.");
                }

                LanguageController.Delete(language);
            }
            catch
            {
                throw;
            }
        }

        /// <summary>
        /// Get all languages.
        /// </summary>
        /// <returns>The dataset of all languages.</returns>
        public static DataSet GetAllLanguages()
        {
            return LanguageController.GetAllLanguages();
        }

        /// <summary>
        /// Check whether the language exists or not.
        /// </summary>
        /// <param name="langaugeName">The language's name.</param>
        /// <returns>The language exists or not.</returns>
        public static bool CheckLanguageExists(string langaugeName)
        {
            try
            {
                if (String.IsNullOrEmpty(langaugeName) || String.IsNullOrEmpty(langaugeName.Trim()))
                {
                    throw new ArgumentNullException("Language name is null.");
                }

                return LanguageController.CheckLanguageExists(langaugeName);
            }
            catch
            {
                throw;
            }
        }
        #endregion

        // Internal methods.
        #region Internal Methods
        #endregion

        // Protected methods.
        #region Protected Methods
        #endregion

        // Private methods.
        #region Private Methods
        #endregion
    }
}